splited code.R into four R files.