functions for test writing