added collision of rectangles on walls