Update a5.py

I almost finished the big parts and now working on debugging.