issue #18. YES, it WORKS!!!
after some refactoring (issue #18)