Program 2.1 listing, haven't tested whether it compiles or not