add debug messages
add wu's algorithm