Added the changes suggested by Jeremy