First approach to reinforcement learning (measuring of N), not satisfactory though.