working on max edges