added 'function' to bash function def, caused syntax errors on some machines otherwise