figured out sub programs. working on encode.