decode() function, lecture 5.3