Changed if( to if ( and for( to for (
Added a by ref $bytes parameter to decode, to allow for calling it from other internal methods