ray creation code fixed
more ray code updates