switch b/w views functionality implemented