Updated the psuedocode in adapter