added documentation and a novel constructor