Added basic collision detection in the y direction