added clear functionality to js and clear button on index