cleaned up the scml.cpp code after the fixes