implement pickle and unpickle
fix typo
be byte order sensitive
correctly treat int