Refactored collision detection, and all the things work for now