I didn't want to be the bad guy Your code try the mathematical approach, i don't see a problem with that, since it may be the best way to do it. What bothers me more is when people pull full 100% code.
Some may argue that it may be close to 100% code, but since it's not perfect and since we are talking about mars lander 1, you can go on
For your code itself, well ask @kijanek6 who seemed to have mastered the math ^^
Good job! I didn't do the mars lander 3 yet but I've seen the test and i agree that maybe a fourth level might be cool in the future.