corrected versoin 2