updated Main script &  doc to improve "switchAfter"