added ray tracing code