Rewrote code according to style guide for Lens.py