change keys method to use keySet instead of entrySet which should be more efficient