added a lot of code for list functions