modified:   optictools.py