refactoring with live code; notes included
refactor sorts