Added printf. Fixed segfault from bad incrementation of input pointer.