Implemented basic collision detection

Needs to be worked on.