added batch learning option