Add SelfLoopsError Exception
add self loop checks; hated removing nice one liners :(
fix pep8