edited constructor method