wrote find_next_assignment method