add constructor
fix tests