added comments to modal.js
fixed some selection bugs on list updating
removed old code
added comments to index.js