yaml conversion algorithm