Initial commit of master and slave code