Went through source files, added matchGS to make calling the gs algorithm faster, one bug remains that causes wrong results for naive algorithm