added algorithm to prune self-matches. also got compiling on codeblocks