my code from zeds learn c the hard way