Optimize the problem with more space