Split visited array in 5, improves performance by 4x
Improve speed by 20x