add encode test
decode tests