added ctor and removed old code