wip
gbellack's patch DO NOT USE
works v1
fix a bug
add test