add logging
template master request thread, add comments