added options to add items to beginning or end of list