Formatted code
Changed floats to doubles