Incorporating some changes proposed by Mateo.