fixed raytracing completely, but wow what a mess