I changed the code slightly