Converter algorhitm