Add Main Event Loop and Functions sections