output isnt good.  still needs debugging