Actual correct math

Actually works :P