@dimdin I am not sure about returning -1 here, what do you think?