added uml diagram
Introduced a method clear() for clarity