renamed var
added blank lines
decode everything
added some comments
moved the code