PA2. Final version with comments and example