Added some more comments
Moved some code outside the for loop to improve performace
Only events in a range are between todays date and a further date are added, and when events are outside that range, the programm terminates