Conversion routine (first draft)