added clear function, minor change