Threaded application

slightly faster, but uses way more memory
may have been a mistake