Changed code to use common list functions