finisht main.cpp code to draw plots, AMSfit