new global calculation script plus fixed up the single site analysis