The code is released under MIT Licence. It shall be noted that all scientific papers in the repository are not under my copyright and therefore are NOT MIT Licenced. They do have their own copyright holders. I'm sharing them here, which I believe is a fair use, which does not infringe the copyright holders rights.
first attempt at final solution