Style improved and minor changes in index.js