adding log (debug) and some tests