corrected copied code