made changes suggested by kylemcd