P2 in c, plus some file cleanup