fixed the magnitude math problem
fixing ray bug
Merge branch 'dan-dev'