Moved from c++0x to c++11
Added link to triad-like algorithm
Merged in changes, fixed indenting