Implemented threading in app.py; significantly improved runtime on multicore processors.