drawLine method now includes list and color as arguments