minor fixes
created helper and plotfigure modules and fixed AAM calculation