Complete rewrite of code focusing on wworking script first, then will move to markdown document.