refactored to speed up guistring rendering because it was lagging