improved main.py
improved code