explanation first, C Code later