Added more verbose console output for getViewHist. Tidied up code formatting