Added rudimentary collision detection