part 3: fixed test logic