move hide/show code in to the didScroll function defined in the view.
clean up unused code and format