computation improved & bug fixed