Closing file in C example.
Removing and unifying global variables mess.
AR plot generation moved to a separate file.
Various changes to the initialization script.