added static qualification to private functions in main