speedups, some parallelization, and documentation