improved search space generator