update function names, improve test coverage - written by Julia but committed by Louis