Changed remove() from a void method to a boolean method.