added public remove function and fixed comparison bug