added readme markdown and comment for generic.cpp