Refactored finding of random passable position into its own function.