New function, documentation and tester script