added tests , updated documentation