Almost working - need validation + unit tests. Calculates "correctly".