corrected and simplified