updated documentation. corrected comments in header.h.
streamlined encoding implementation.
adjusted encoding implementation for support of multiple file formats.