improved file manip example