Added learning function. Algorithmically functional, needs tuning tho.