got file buffer stuff working..but buffering in wrong place