drastically increased max counts to help for 511 line fitting
Changed the way max counts are calculated