updated docs, added type annotations