Add data analysis machinery; generalize S1