changed first_non_null -> first_valid_index; updated referenced