My solution for the PA1