more methods implemented, decode has problems, test fails, to be fixed