Fundamentals of learning and motivation