finished mira.py