clear function