proper bounding box calculation; environment variables support