revise calculatiob of sd