Modified code to fit PRS-2 standard.