code cleanup and added sanity checks on the inputs. need to add more checks, consistent with PeakFQ and HEC-SSP. also need to add graphics functions.