completed function for lorey2agb