change parameter type and test file
add stack to use bfs
add direction detection