misc. changes to make it work f. p2n