simple slave and master code