Added initial instrument detection code.