refactored the code for the first case of encode and decode.
Merge branch 'master' of https://github.com/Kae7in/CS361_Assignment_3