fix bug and finish exercise 2