master and slave complete