added most inline code
can't get output of header for finding modes