updated typing and documentation