first commit
added last reimplementation attempt. attempts done in late 2011, but didn't have time / disposition to finish. it does not compile.