made corrections to list_lab.py and improved the code