Fix bug in part1