incorporated changes from Jay Jacobs.