I am working on a homework problem and have a function `compress(S)` which takes a binary string. It calls another function, `count(S)` which returns the number of consecutive digits at the beginning of the string. It recursively calls `count(S)` for the entire string, and creates a list of the number of consecutive digits. For example, `compress('111000111')` would return [3, 3, 3]. 

Another function is then called, `reduction(n)` which takes in an `int` and returns a list in which none of the numbers are greater than a set value, `COMPRESSED_BLOCK_SIZE`. It also alternates with 0s if the number must be split up. For example `reduction(5)` returns [2, 0, 2, 0, 1] if `COMPRESSED_BLOCK_SIZE` is 2.

This is my code so far.

```
def count(S):
    if len(S) == 1:
        return 1
    if S[0] == S[1]:
        return 1 + count(S[1:])
    return 1

def reduction(n):
    if n <= COMPRESSED_BLOCK_SIZE:
        return [n]
    return [COMPRESSED_BLOCK_SIZE] + [0] + reduction(n-COMPRESSED_BLOCK_SIZE)

def compress(S):
    if S == '':
        return []
    values = [count(S)] + compress(S[count(S):])
    red_vals = list(map(reduction, values))
    return red_vals

```

The reduction function is working but when the `compress(S)` function calls `reduction(values)` using the map function, I get an error: unorderable types: list() <= int(). The values in the values list are ints so I don't understand why I am getting this error if map is supposed to iterate through the list of ints when calling `reduction`.

Thank you!