cleaner, better commenting, fixed some vital calculation mistakes, still broken