Figured out the discrepancy with my formula. I changed an integer to a float value. Added some documentation to explain the parts of the formula.