Fixed calculation error + added some more parameters