finished rework of rendering, needs bugfixing and a lot of  optimization