Re-implent flex-shrink for testing