fixed bug in method remove() that failed to remove the second element of a set