Implemented clear function.