added function to fit the background and the cloud