builiding yield curve in a separate function