http://petr-mitrichev.blogspot.com/2015/10/a-week-with-old-self.html
UPD. I've originally forgot to include function extraMatrix in the code I posted, and it contains an important part of the logic. Post updated.
A week with old self
http://petr-mitrichev.blogspot.com/2015/10/a-week-with-old-self.html
UPD. I've originally forgot to include function extraMatrix in the code I posted, and it contains an important part of the logic. Post updated.