added documation to extraction functions and roxygenized