more sensible convert function