partially done with input/output for spark