add code from c tutorial