Redid some argparsing and reorganized some code