improve the function C and index.php