the 8 lines above are repeated in both tests