closes #2 - implemented in both branches