You shouldn't need to store the return of gets in the variable term, just let ruby return the last line.