got raytrace and raycast implemented