Some collection functions in C