Modified code of basin size problem