use splice for remove, this remove the element and decrease the length