Added longtest version with external variables