generalized learning algorithm and imporvment on dt, but still errors with 2 rotations