debug
correctly figure out loop var delta