merged rphd into mypkg and put some loose code in here too