Finished implementation of remove()