Cleaned up code
Fixed CodePiece on neg. Values
Added Unit Tests