implement block collision detection