An Algorithm for Equilibrium in a Dynamic Stochastic Monetary Economy