Reworked File IO slightly