Use /usr/bin/env python2 instead of /usr/bin/python2.
Use log2 instead of log10.