@ pp: working on learning algorithm