work done on ordering issues
renamed sub_model -> sub_model_id