Add code for problem #12