first version
add license and fix bug