backend almost complete with multithreading added