Simplified the API. Added documentation