Finished implementation for Master side