Modified template definition and small edits to ToPNGraphMP