added configurable threshold support
added types to docs