Implemented improved Gaussian fits for start end code