write tests @kfang