(Hopefully) updated to work in the latest version.