Fix the problem of arguments. TODO: 1. fix the static avariables defined inside the functions (do not treat them as global but local); 2. Try other parameters