replicate #1
fix #1 and bump to 0.3.1