Flexibility in the future smart distribution grid