added output string from main method
new 'func' method used instead of cout