Implementing the clear function