modified decode.c