also swap for variables in completion algorithm