added NIR functionality