command line functionality & removed threading