Updated script header and documentation, further testing with thresholds