added output, rewritten help
added output function, removed useless lines
added output support to main