Wrap collison JS code within a function
Wrap code for selection example within a function