Order of logic changed to accommodate viewing