completed tee.c, works