updated with working textoutput