Working remove function