Change: Move explore() function out of procedural code.