Fixing style and adding comments