Added addToList function