Changed return type  from float to double