cleaned up cal.py