[27] - added extract function for current result set
     - removed all memory leaks hopefully