optimizations for bfs, under .6s for p4