add conditional to format_whitespace method