Made a lot of changes, everything works except the learning part