adds command-line input and makes use of bradens sorting thing
made some changes