More work on PA2 code