6.10-before
refactor
substitute algorithm