Slight mods. Needs review.