O(1) space