formatted code for now working thread.c, needs comments still
added files, fixed merge conflict in thread.c