rework
Possible performance improvement in naive
Merge branch 'master' of https://github.com/kasper0406/AlgEng