Add some function and more tests