fix issue #11
various optimizations