Adding test code to debug persm