added changes suggested by ian