changed integers to doubles where necessary