changed var to double