exercise 1.39.

Problem not working right - can't get reasonable values from it
Must have the implementation just a bit off.
completed exercise 1.39

Took me a while to see the error in my function.  Firstly - i should
have stuck with the easy/dumb way to set up N and D instead of trying
to be clever. Secondly even after that - it was hard to see my
remaining error (didn't completly change to easy/dumb vesion)