Fixed errors. Typos etc. Made import closer to style guide. Style from sympy import *
Rewritten with loops for all checks.