cache Vector sample functions
Assignment 2 modifications