Added working clear function