ok, moving function into instruments.js file