Adding function for modifying a list