Changes to the PA code.

Added some changes to de PA code.
To Do: Translate some comments and remove the main function (just for
demonstration).