Added the fit() method