Cleaned up list function