working on input, seg fault