Making the code match the requirements a little more closely