fixed double calculation