Added functional clear button and added comments