working texture loading. will need refactoring.