added mipmap functionality