rebase depth starting at 0
code tidy