printKeys() prints keys in sorted order