Improves bogoSort memory performance