working through www.learn-c.org tutorial