re-factored home view 

Boolean variables were checked using ==1 and == 0 used ! operator instead. Added few comments.