adding clear button and functionality