Add documentation.
Simplify the check for whether the same package exists.