functionality to main.py

Made sure inputs are correct and doesnt crash