Added main() guard

So you can import this function in another one without executing the main() part.