raycasting mostly fixed