Lines to array implementation