Large update

change some of the function argument to follow user setting.