implemented basic ray tracing algo