Added comments and removed irrelevant code
Fix styling