Added main command loop