Update 531.py

Separated everything and put the imports on a new line. May eventually clean up the variables ( maybe ).