Prime factor, dijkstra, return and cipher