some comments with ideas, + debugging options, refactoring.