added clearing functionality from outside the class