Initial changes to capHistConvert
More changes to capHistConvert
More changes to capHistConvert()
Still more changes to capHistConvert().