switch to class implementation
add some options. allow mincut