Various utility functions like binary search, mainly to get familiar with C