add clear and empty methods and tests