Working version with mavericks