A liitle more completed code for the ARI (the php ari became cleaner)