Added runState for bfs
Added solveM to bfs