changed type from float to double to avoid errors