Refactored, and corrected things.