How to prevent floods and droughts