Completely redid learning.py