public string SearchBackward(string term)
{
for (int i = 0; i < count; i++)
{
int slot = cursor - i - 1;
if (slot < 0)
slot = history.Length + slot;
if (slot >= history.Length)
slot = 0;
if (history[slot] != null && history[slot].IndexOf(term) != -1)
{
cursor = slot;
return history[slot];
}
}
return null;
}