minor modification of hmean