improved the C driver program