Added function that takes list