begin command loop