Adding online wavefront
Fixing header and init of vars.