Just a quick note on the cast in my srand call -- srand ideally takes an unsigned int but time comes back with a one that is of type time_t, which is normally a typedef of integer. srand() may generate a warning otherwise.
thanks for that jonsca. i thought my rand call looked a little light. also thanks for correcting my spelling. i can never get that one right and Ive used it a few times. just doesn't stick right in my head.