simplified pa5 with r+