fixing calculation - now it works!!! (hopefully :)   )