Implementing the list command