Changed the data type of currentPeriod and...

...currentPiece to Byte, added some much needed comments to some of the
newer work.