Updated documentation. Added tests