use syncronous io to be less memory intensive