Added tests & refactored to make Semaphore happy