big refactor
fix initial theta
bug fix