working first version of collision detection