Added skeleton code for events loops and sources