moved tga fucntions into their own file