added tests, examples and renamed entry function