changed integer calculations for kinglemming