implemented txtplot function