added static analysis, unit tests