Added viewAll function. 
Added switch(viewType) in view function.