Modeling Avalanches