put raytracing code in a separate file