changed the result type to float