implement bind, do, add some debugging features