working version of PA2