my solution for pa2