Some Bugs in calculating