Version 6, changed ints to doubles