add makevector and cachemean code to use as basis for submission