Added kernel formatting function