Add main_func.cpp
Merge branch 'hotfix/1391391701-issue-9' / close #9