Implemented 2 dimensional indexing for semaphores class