initial code; implements plugin, reads header