My earthmoon example still isn't working: currently the Earth is in a very elliptical orbit around the sun (with the initial location as the apapsis) and the Moon is never bound to the Earth.  I've checked and rechecked the numbers and my extra code and can't find what's wrong, feel free to try yourself if you want to.