Incorporating Cliburn Chan's vectorization examples (with fixes)