still need final output
final version with output