Added clear button & other minor optimizations.