Made code compatible for lower end graphics chipset.