new module directly imported from snanalysis (as it is)
fix interface
updates
minimal compiling version