Changed floating point precision to doubles