added functions and print