Create main() function in python. fixes #2