add some testing and reference code