'Checks if there are any deleted elements in data to rewrite and prevent from writing then back.'

def _update_if_has_deleted(self, leaf_start, records_to_rewrite, start_position, new_record_data):

    curr_index = 0
    nr_of_elements = self.node_capacity
    records_to_rewrite = list(records_to_rewrite)
    for status in records_to_rewrite[4::5]:
        if (status != 'o'):
            del records_to_rewrite[(curr_index * 5):((curr_index * 5) + 5)]
            nr_of_elements -= 1
        else:
            curr_index += 1
    if (nr_of_elements < self.node_capacity):
        data_split_index = 0
        for key in records_to_rewrite[0::5]:
            if (key > new_record_data[0]):
                break
            else:
                data_split_index += 1
        records_to_rewrite = ((records_to_rewrite[:(data_split_index * 5)] + new_record_data) + records_to_rewrite[(data_split_index * 5):])
        (self._update_leaf_ready_data(leaf_start, start_position, (nr_of_elements + 1), records_to_rewrite),)
        return True
    else:
        return False
