rewrite of getsummary function, no longer version dependent.