simplified ray tracer code a little