added support for textures but still have bugs