updated Texture code for counter