adjusted custat classes ordering
initial version of buildCFG