recoded the stack decoder and splits it into models.py and
stack_decoder.py