simplified several portions of code through replacing rect structs with x,y,h,w count...