Code Cleanup & Comments Added

Dashboard code cleaned up and simplified