Add element to array with push and splice, and remove with splice