remove flag, add a constructor, tested