updated to use vectors throughout. Note that update(vector<vector<float>>) no longer takes a second arg.