added downsample() and connected it with button
replaced std output with output window