Fixed bug in part 3