new constructors and fixed bugs