Adding commentary, cleaning up input_loop_thread