Funtions with test for __main__