Part 1 worked for both cases