master implemented, to finish slave