random learning implemented and testing