added the method isEmpty()