3/4 of program now converted, also fixed a bug with direction deriving