Remove broken tiff library
Add a few discrete math functions