Moved functions to class, added dictionary, added plotting, etc.