added collision detection!