added Calculate_SOT code, lower level for the analysis