Made list command dynamic

I made the list command dynamic