Reinforcement Learning for Motor Primitives