fixed decode functions. it's work
modified cutAndGetResidue fuction
Remove unnecessary variable