Margin calculation for tuples (Travis CI build)