debugged code & decoder