adds inserts and bool flag to determine if we'll insert