Uploaded main.c code(Multithreaded), code builds not tested yet.