Added basic support for selections in main.js