What are the main functions of instrumentation?