switch to argparse, add option for iterations, add hooks for internal logging