Modeling the dynamics of salt marsh formation