Offloaded the plotting functions into a separate file and added support for .cfg files, TODO: Fix some bugs