Added comments to the migrate function