added code to TextureAtlas