Source: https://github.com/ossu/computer-science/files/6085884/lpn.pdf