Fixed floating point division. Refactored code.