update space complexity