lp and events no longer hard coded

plus some re-indentation
round-robin open and write data files
typos and compile warnings