Algorithms for Brownian dynamics