This is mostly derived from KaVir?'s webpages and code found in game.org repositories. I'm totally clueless and this is my best guess. The code with yellow lines is missing documentation and/or licenses.