Added few comments and replaced tabs with spaces