pep8ified and cleaned up example codes