speedup figure rendering removal of .startswith() calls and use generators instead of for loops