Fixed runtime errors!  Encoding and decoding will now complete successfully.  However issues with the algorithm are producing incorrect solutions.