initial commit with zero error checks, tons of assumptions made, but it
works when the planets are aligned!