improved version.