Restructure OCC algorithm
Restructure OCC algorithm