Made minor changes to Raycasting