Shouldn't this function return an integer?