finalized multithreading, reworked the renderer, added byte flags