this version passes the testsuite with g=3