Fixing JS style and adding more comments