learning and end state added