added a lot of remove() code