added functional interface / updated doc and tests