separate filename iterator logic
rewrote argument parsing using argparse
made free.py work with python 3