Suggest to return -1 instead of undefined because this function is to return a number.