Implemented collision detection
Improved collision detection and moved it to its own class