Trying to fix render alg 1