adding in starting of the two scheduler threads, as well as fixing syncronization issues