added segment add method
refactored map iteration
renamed segment remove to delete and it is multiple delete rather than one