Fixed bug. Added docs.