Cleaning up code.
Increased testing of python logic.
Cleaning up.