Made program handle ~/ prefix by using os.path.expanduser()