Added new file instrument.py (missing from previous commit)