-w param added for history scaling