If this works out, we don't need the custom function