Fixed drawing of table and used built in semaphore class