Created the constructor method.