Added collision detection for blocks