Implementation of remove(i)