A slightly more compatible version