Updated replacement thanks to @tef and @DRMacIver