avoiding unnecessary calculation. calculation time is reduced to 93s fro...

...m 260s