Adapted to newest version of adept.