small fixes
add benchmark
complete rewrite