ben-guin's read_ipr function