add function for list manipulation with tests