fixed certain calculation issue.