Added an id field
changed slice to splice