add logging code and modify readme