Simplified and corrected