calculation fixes