Finished input processing code