Add refraction

Only the logic for the trace algorithms.