Code for fits, clean