updated texture code