finish purpose.py and random.py