modify Space Complexity