changed conversion function