Update main.js

Made selectionObserver decision more elegant
Merge pull request #9 from gevious/patch-1

Update main.js