How is it that the Cup took Harry escaped the graveyard with Cedric's body which took them back to Hogwarts when Harry touched it?
Was it possibly Dumbledore that made it?
And also how did James Potter's echo know that the Portkey would return Harry to Hogwarts?