First rough version of improved convert