function to check for presence of reg keys
pass vectors by reference instead of by value