Conform to "use strict";

Slight clean-up and declare "var selected" for strict mode operation since it's reinitialized each time and was being initialized without declaration