Lisp code is here https://gist.github.com/W-Net-AI/11205892