Implemented Next Operation

New implementation of #66.