updated Run_CS function for debugging