An encoder and decoder written in Scheme(Functional programming)