use splice to create new array