added tests. compatible with node