clean up; updated for 5p model