implement next button (fixes #73. Hasn’t been tested thoroughly, so might produce wrong results)