Added validation for randomizing start and goal positions.