def fib_memo(n):
    """
    uses memoization to reduce calculations by retrieving what has already been calculated
    :param n: number
    :return: resulting fibonacci
    """
    known = {0: 0, 1: 1}
    if n in known:
        return known[n]

    res = fib_memo(n - 1) + fib_memo(n - 2)
    known[n] = res
    return res