many changes, focused on speed up; may have broke the math though