Cleanup, trying to find a better render algorithm than that monstrosity i just wrote