function sweep, remove in single linked list