Redefined instrument funs

Completely changed structure for defining functions