moved test block to EOF