Moved metro algorithm-code