working on data output
working version with output