Finished primary work on semaphores, implemented mutexing