added a multi fit function