added ray tracer function