Fixed up collision detection and cleaned up code