Optimeze code,add functions,delete functions