worked further on the output part