changed to take file input