ref #77 factor out a light method
ref #77 reduce code duplication by introducing the main path tracing loop.
code is almost equivalent to and thus equally broken as the last version
ref #77 work around the artifacts