completely revamped code for creating processes threads and doing their respective context switches