add marshal and few test codes