Shorten margin calculation function by making it much less obvious...
