incorporate changes suggested by Kevin Moser