begin writing in file input functionality. This commit breaks functionality but nobody is using this anyway, so it doesn't matter :P