Added 'inject' function to incorporate numbers in 'lines' array