save Function in vector<share_ptr<Function>> instead of map<int,Function>