fixed output module, fixed a few bugs with keithl