create function for list