homework 2 uses file input