changed all occurrences of insert to add