Draw borders and fix bouncing out of borders