Notes Binary search divides current list into 2 and makes comparison on second part first. port_search gets wrong index in this case. Fix port_search() !!! If for example list is like 10, 15-19, 20 and user adds 11-14 it should merge like 10-19, 20. Fix that. Check "value", if it is same then merge or split otherwise don't. ?????? Complicated count occurences of same value ## Adding new entry 0. Store lower and upper ranges and index of those ranges 1. Get the count. 2. Allocate new table 3. Copy all ports or ranges (whose value is not equal to entered value) to the new table 4. Copy not affected ports or ranges (whose value is equal) to the new table 5. Copy entry (merged) or add entry 6. Sort ## Deleting entry 0. Store lower and upper ranges and index of those ranges 1. Get the count. 2. Allocate new table 3. Copy all ports or ranges (whose value is not equal to entered value) to the new table 4. Copy not affected ports or ranges (whose value is equal) to the new table 5. Copy entry (splitted) or delete entry 6. Sort