Add bounding box calculation and other function in calculations.py

Avoid if-without-else  (and I'm not really clear on what this check is for in the first place)