Rearranged input handling; Added support for passing a proxy (-x)