updated group ans squaring algo with working tests
Merge pull request #20 from bobolinks-2014/group-sq-refactor

updated group ans squaring algo with working tests