refactored labo2.py