Wrote clear function but did not test.
Finished clear and tested it.