Encoding method was implemented and some tests was created.