penalty calculation