added the list command

This should easily merge the original pull request (#586)
These changes shouldn't be in here I think...