slightly modified genTest