Made the changes suggested by Brian