collision with restitution working, raycasting with some bugs