Added function documentation to vectorize