Algorithm change
made encode.c work. Made mostly pseudocode in decode