Structure of program (credit to murat/teaorbit)