Fix remove method to use splice instead of slice