2012 version of x-section script (work in progress)