Updated with BDES to K script from Mark Hogan.