scheme works now. next step: refactoring and finding some edge cases in which it fails
added some doc