implemented output
made the codes work