Code for PA2