added collision detection (not working yet)