Started to work on the decode function.