Fixing bugs in algorithm
Merge branch 'master' of https://github.com/nickmaxwell10/ncog