Made some changes suggested by Michael