added plotting of twi using a histogram approach