calculations bug raised due to change from int to double