exercise 12-13: add assign function to Vec class