added makeVector and cachemean.

Copied code from assignment description.