Added concurrency to functions (where needed)

and some functions to create random matrixes and vectors