fixed some issues with bouncing and collision detection