Merge branch 'master' into dev
working code, but needs refactoring and documentation
Merge branch 'rank_set'