commit before change of all floats to doubles to see if sorts out rounding and calc errors