Initial functions

Should turn this into a class and protect $hashtable and $keys