Got it working for small example
Main algorithm text file