restored non-parallel version