main for master