Added comments and removed irrelevant code
Fix styling
fix merge conflicts