buttload of stuff to make c version of utility