updated per greg's suggestion