Completed exercise2/1 (still contains errors)