adjusted block, added global var