Added most of the remove method.