implementation of ZDD