HW 5 v1

First attempts. Taking a long damn time to solve problems with "result".
I understand the counter logic, but can't get result to work.