Changed var names, back to using ComputeMinWork()

Not good idea to have Global and local variables with the same name.
Note to self: Pay more attention dude!