Issue #8 . Also added some documentation