Code for adding to list