added wait (thanks to Jacques Frechet)
slightly better docs