changed conversion to be use type double instead int