Code Clean-Up

Cleans up code, adds more comments, removes dead code. Still does not
function, except with certain values. Haven't been able to ascertain
what causes it to not work with some numbers, but there is an error
where the working value becomes NaN. Using float point numbers is not
necessary, removing the use of floating points could fix errors.