added gl scaling