Added constructor function