Last process missing.
Now calculates alright. Needs some organization.
A bit of clean code.
More cleanup.