added threads

removed unused code.
added progress bar circle to ui thread, moved ping function to separate
thread to prevent screen freezing