added corrected solution