Implemented depth limited search.