Updated encoding to handle larger data sets.

Updated Unit tests for larger data. Still working on this bit.