Changes insert and remove to return updated structure. Keeping the lists
persistent after operation.