Added some file i/o stuff