debugged poisson and some mild file refactoring