Created print function for each event

Need to complete this function asap
Take special care to initializing semaphores, do not use sem_init()
because it does not work on OS X. Instead use sem_open() and sem_close()
cleaned code
Comments / spacing / cleaned code
deleted lines
deleted lines