moved main() to separate file