made improvements to explore algorithm